/*
 * @Author: your name
 * @Date: 2022-01-08 18:20:04
 * @LastEditTime: 2022-01-09 10:11:01
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \code\source-code-big-data\js\apiDetails.js
 */

window.onload = function(){
    //配置
    var config = {
        vx: 4,//点x轴速度,正为右，负为左
        vy:  4,//点y轴速度
        height: 2,//点高宽，其实为正方形，所以不宜太大
        width: 2,
        count: 100,//点个数
        color: "100, 100, 100",//点颜色
        stroke: "50,50,50",//线条颜色
        dist: 6000,//点吸附距离
        e_dist: 20000,//鼠标吸附加速距离
        max_conn: 10//点到点最大连接数
    }
    //调用
    CanvasParticle(config,'bannerCon');
}

// 获取所有LI
let lis=document.querySelectorAll('.selects')
let quantitySpan=document.querySelector('.quantity')
let totalI=document.querySelector('.total')
lis.forEach(function(v,i){
    v.addEventListener('click',function(){
        lis.forEach(function(v,i){
            v.classList.remove('gion_r_ac')
        })
        this.classList.add('gion_r_ac')
        quantitySpan.textContent=v.getAttribute('quantity')
        totalI.textContent='￥'+v.getAttribute('total')
    })
})


// 鼠标移入移出事件
let gionScan=document.querySelector('.gion_r_scan')
console.log(gionScan);
let gionDiv=document.querySelector('.gion_r_scan>div')
gionScan.addEventListener('mouseover',function(){
    gionDiv.className='gion_r_code'
})
gionScan.addEventListener('mouseout',function(){
    gionDiv.className=''
})





// 选项卡部分
let option=document.querySelectorAll('.option>ul>li')
let card=document.querySelectorAll('.card li')
option.forEach(function(open,i){
    open.addEventListener('click',function(){
        option.forEach(function(open,i){
            open.classList.remove('option_bright')
            card[i].classList.remove('card_show')
        })
        open.classList.add('option_bright')
        card[i].classList.add('card_show')
    })
})
